package xnet.events
{
	import flash.events.Event;
	import flash.utils.ByteArray;
	
	public class SocketEvent extends Event
	{
		import flash.events.SecurityErrorEvent;
		import flash.events.IOErrorEvent;
		import flash.events.ProgressEvent;
		import flash.events.Event;
		
		/**通过Event传输的对象**/
		private var _data:Object;
		
		public static const SECURITY_ERROR_EVENT:String = SecurityErrorEvent.SECURITY_ERROR;
		public static const IO_ERROR:String = IOErrorEvent.IO_ERROR;
		public static const CONNECT:String = Event.CONNECT;
		public static const CLOSE:String = Event.CLOSE;
		public static const RECEIEVED:String = 'receieved';
		public static const READY:String = 'ready';
		public static const SENDING:String = 'sending';
		public static const DECODE_ERROR:String = 'decodeError';
		public static const PROGRESS_DATA_EVENT:String = ProgressEvent.SOCKET_DATA;
		
		public function SocketEvent(type:String , data:Object = null)
		{
			super(type , true);
			_data = data;
		}
		
		public function get data():Object
		{
			return _data;	
		}
		
		override public function clone():Event
		{
			return new  SocketEvent(type);
		}
		
	}
}